<?php
namespace app\index\controller;
use think\Controller;
use think\Db;
class Index extends Base{
    public function index()
    {
       //最新发布文章与统计
        $article = Db::name('article')->order('update_time desc')->paginate(6);
        $count = $article->lastPage();
        //网站公告
        $gonggao = Db::name('notice')->order('update_time desc')->select();
        $this->assign('gonggao',$gonggao);
        $this->assign('count', $count);
        $this->assign('article',$article);
        return view();
    }
}
